package com.mojito.learn.module.other.mybatis;

import com.mojito.learn.business.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * description
 *
 * @author liufengqiang <liufengqiang@touchealth.com>
 * @date 2020-04-23 14:35
 */
@Component
@Mapper
public interface AnnotationMapper {

    @Select("select * from sys_user where id = #{id}")
    @Results(id = "learnMap", value = {
            @Result(column = "id", property = "id", javaType = Long.class)
    })
    User findByUserId(@Param("id") Long id);
}
